<script type="text/javascript">
    /*function edit_validate(){
        alert("hello");
        var news_comment_content= document.getElementById('news_comment_content').value;
        if((news_comment_content.length < 17) || (news_comment_content.length > 1000)){
            document.getElementById('error').innerHTML = 'Nội dung phải đủ 10 ký tự';
            return false;
        }
        else{
            return true;
        }
    }*/
</script>
<div class="heading">
    <div class="left_heading"></div>
                                
    <div class="content_heading">
        <h3>Sửa comment tin</h3>
    </div>
                                
    <div class="right_heading"></div>
</div><!-- End .heading -->

<div class="main_content">
    <form name="myform" action="" method="post" onsubmit="return edit_validate()">      
        <table class="table_content">
			<tr>
				<td class="label"><?php echo $this->formLabel('ID', 'Thứ tự'); ?><span class="msg"> * </span></td>
				<td class="label2"><?php echo $this->formText('news_comment_id', $this->data['news_comment_id'], array('id' => 'news_comment_id', 'class' => 'input','disabled' => 'disabled')); ?></td>
            </tr>
            <tr> 
                <td class="label1"><?php echo $this->formLabel('user_id', 'Mã người dùng'); ?><span class="msg"> * </span></td>
                <td>
                    <select name = "user_id" id="user_id">
                        <?php 
                            $user = new Admin_Model_User;
                            $show = $user->list_User();
                            foreach($show as $value)
                            {
                        ?>
                        <option class="label"value ="<?php echo $value['user_id'];?>"><?php echo $value['user_id'];?></option>
                        <?php }?>
                    </select>
                </td>
            </tr> 
            <tr> 
                <td class="label1"><?php echo $this->formLabel('news_id', 'Mã tin tức'); ?><span class="msg"> * </span></td>
                <td>
                    <select name = "news_id" id="news_id">
                        <?php 
                            $news = new Admin_Model_News;
                            $show = $news->listNews();
                            foreach($show as $value)
                            {
                        ?>
                        <option class="label"value ="<?php echo $value['news_id'];?>"><?php echo $value['news_id'];?></option>
                        <?php }?>
                    </select>
                </td>
            </tr> 
            <tr>
                <td class="label1"><?php echo $this->formLabel('news_comment_content', 'Nội dung'); ?><span class="msg"> * </span></td>
                <td class="label2"><?php echo $this->formTextarea('news_comment_content', $this->data['news_comment_content'], array('id' => 'news_comment_content', 'class' => 'input')); ?></td>
                <td><span class="msg" id="error"><?php echo $this->error; ?></span></td>
            </tr>  
            <tr>
                <td class="label1"><?php echo $this->formLabel('create_date', 'Ngày tạo'); ?><span class="msg"> * </span></td>
                <td class="label2"><?php echo $this->formText('create_date', $this->data['create_date'], array('id' => 'create_date', 'class' => 'input','disabled' => 'disabled')); ?></td>
            </tr>  
            <tr>
                <td class="label"><?php echo $this->formLabel('status','Status',array('class'=>'label')) ;?><span class="msg"> * </span></td>
                <td >
                    <?php
                    echo $this->formSelect('status',null,array('id'=>'status','class'=>'label'),array('0'=>'0','1'=>'1'));
                    ?>
                </td>
            </tr>
			<tr>
				<td class="label3">&nbsp;</td>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td class="label3"></td>
				<td colspan="3">
					<input class="button" type="submit" name="submit" value="Cập nhật"/>
					<input class="button" type="reset" name="reset" value="Nhập lại"/>
					<a href="<?php echo $this->baseUrl('admin/newscomment'); ?>" class="button" style="padding-top: 7px;">Quay lại</a>
				</td>
			</tr>
        </table>
    </form>
</div><!-- End .main_content -->  